﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GPCSC.Webs;
using GPCSC.Model;
using System.Collections;
using NickLee.Common;
using System.Data;


namespace GPCSC.Web.CM
{
    public partial class DWMQ : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                f_bound();
            }
        }
        protected void f_bound()
        {
            //type 1 民情日记 2 调研报告
            string type = Usual.f_querystringToString("type");
            CL_USER_S user = reUser();
            Hashtable htable = new Hashtable();
            DataSet ds = new DataSet();
            if (type == "1")
            {
                Grid1.Title = "民情日记列表";
                htable.Add("@CL_POSTID_PK", user.CL_POSTID_PK.ToString());
                ds = new DataReturn().ReturnData(htable, "select_dwmq");

            }
            else if (type == "2")
            {
                Grid1.Title = "调研报告列表";
                htable.Add("@CL_POSTID_PK", user.CL_POSTID_PK.ToString());
                ds = new DataReturn().ReturnData(htable, "select_dwdy");
            }
            Grid1.DataSource = ds.Tables[0];
            Grid1.DataBind();

        }
        public CL_USER_S reUser()
        {
            byte[] userInfo = (byte[])base.o_baseTable[c_obj.s_userInfo];
            Hashtable userInfoTable = CompressData.UnCompressHashtable(userInfo);
            CL_USER_S users = (GPCSC.Model.CL_USER_S)userInfoTable["SYS_USER"];

            return users;
        }
        protected string GetEditUrl(object id)
        {
            return "javascript:" + Window1.GetShowReference("DWmd_V.aspx?type="+Usual.f_querystringToString("type")+"&id="+id.ToString());
        }
    }
}